package Chapter10_InnerClass;

/**
 * Date: 2019/2/19
 * Time: 10:53
 * User: Driss.
 */
public class DotNew {
    public class Inner{
        public void print(){
            System.out.println("test");
        }
    }

    public void test(){
        //this is no problem
        Inner inner = new Inner();
        inner.print();
    }

    public static void main(String[] args) {
        DotNew dotNew = new DotNew();
        Inner inner = dotNew.new Inner();
        inner.print();

        dotNew.test();

        //报错：DotNew.this can't be referenced from a static context
        //Inner inner1 = new Inner();
    }
}
